package server;

import java.io.IOException;

import listeners.BackupServerListener;
import listeners.MainServerListener;

public class Starter {
	
	private HighPrioReceptor highReceptor;
	private LowPrioReceptor lowReceptor;
	
	private MainServerListener mainListener;
	private BackupServerListener backupListener;
	
	private Conf conf;
	
	public Starter() throws IOException{
		
		conf = new Conf();
		
		highReceptor = new HighPrioReceptor(conf);
		lowReceptor = new LowPrioReceptor(conf);
		
		mainListener = new MainServerListener(conf);
		backupListener = new BackupServerListener(conf);
	}
	
	public void execute(){
		
		System.out.println("Despachador iniciado...");
		
		highReceptor.start();
		lowReceptor.start();
		
		mainListener.start();
		backupListener.start();
	}
	
	public static void main(String[] args) {
		
		try{
			Starter s = new Starter();
			s.execute();
		}
		catch(IOException e){
			e.printStackTrace();
		}
		
	}

}
